<?php 
function getCategoryUrl($field){
	switch ($field['url_type']) {
		case 2:
			return __ROOT__.'/hd/'.$field['html_dir'].'/'.'index.html';
			break;		
		default:
			return U("Index/Index/category",array('cid'=>$field['cid']));
			break;
	}
}

function getContentUrl($field){
	switch ($field['url_type']) {
		case 2:
			$search=array(
				'{y}','{m}','{d}','{aid}'
			);
			$date=getdate($field['addtime']);
			$replace=array(
				$date['year'],
				$date['mon'],
				$date['mday'],
				$field['aid']
			);
			return __ROOT__.'hd/'.$field['html_dir'].'/'.str_replace($search, $replace, $field['arc_html_rule']);
			break;
		
		default:
			return U('Index/Index/content',array('aid'=>$field['aid']));
			break;
	}
}

?>